package com.qs.action;



import java.util.List;

import com.opensymphony.xwork2.ActionSupport;
import com.qs.entity.DailyMessage;
import com.qs.imp.DailyMessageImp;

public class DailyMessageAction extends ActionSupport{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private DailyMessage newMessage;
	private int id;
	private List<DailyMessage> messages;
	
	

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public List<DailyMessage> getMessages() {
		return messages;
	}

	public void setMessages(List<DailyMessage> messages) {
		this.messages = messages;
	}

	public DailyMessage getNewMessage() {
		return newMessage;
	}

	public void setNewMessage(DailyMessage newMessage) {
		this.newMessage = newMessage;
	}
	public String newMessage() throws Exception {
		newMessage.setDailyId(id);
		newMessage.setPostTime(new java.sql.Date(new java.util.Date().getTime()));
		new DailyMessageImp().newMessage(newMessage);
		messages=new DailyMessageImp().getMessage(id);
		return SUCCESS;
	}

}
